import pandas as pd
= pd.read_csv("../../data_sources/coffee_survey.csv")
df import matplotlib.pyplot as plt
import seaborn as sns
= df,
sns.catplot (data = "coffee_c_personal_preference",
x = "coffee_c_bitterness",
y = "box") kind
Analysis of Coffee Preference
Comparing personal preferences and bitterness for CoffeeC
Distribution of Age
= df, y = "age") sns.displot(data
Distribution of Favourite coffee
= df,
sns.displot(data = "favourite",
y = 1) binwidth
Favourite coffee based on gender
= df, x = "gender", y = "favourite")
sns.displot(data =45, ha='right') plt.xticks(rotation
([0, 1, 2, 3, 4],
[Text(0, 0, 'Other (please specify)'),
Text(1, 0, 'Female'),
Text(2, 0, 'Male'),
Text(3, 0, 'Non-binary'),
Text(4, 0, 'Prefer not to say')])
Preferred Coffee Style
= ['Pourover', 'Latte','Drip coffee', 'Cappuccino', 'Espresso','Cortado','Americano', 'Iced coffee', 'Mocha','Cold brew','Other', 'Blended drinks']
names = [1026, 654, 415, 330, 309, 295, 238, 147, 116, 108, 105, 45]
size # Create a circle at the center of the plot
= plt.Circle( (0,0), 0.7, color='white')
my_circle # Give color names
=names, colors=['red','green','blue','skyblue'])
plt.pie(size, labels= plt.gcf()
p
p.gca().add_artist(my_circle)
# Show the graph
plt.show()